"ui";
//2019.4.2 12.06
ui.layout(
    <vertical>
        <horizontal>
            <img id="exit" src="file://./res/ic_keyboard_backspace_black_48dp.png" w="40" h="40" gravity="center"/>
            <text text="强制聊天"  textColor="#333333" textSize="27sp" typeface="serif" gravity="top|center" w="*" textStyle="bold"/>
        </horizontal>
        <vertical padding="16">
            <input id="input" digit="0123456789" hint="在这里输入QQ号："/>
            <button id="ok" text="确定"/>
        </vertical>
    </vertical>
);
ui.exit.on("click", () => {
    ui.finish()
});

ui.ok.on("click", () => {
    let qq = ui.input.text();
    if (qq.length < 11 && qq.length > 5) {
        app.startActivity({
            action: "android.intent.action.VIEW",
            data: "mqq://im/chat?chat_type=wpa&version=1&src_type=web&uin=" + qq,
            packageName: "com.tencent.mobileqq",
        });
    } else {
        toast("请输入正确的QQ号码");
    }
});